#include <bits/stdc++.h>
using namespace std;
int guaili[10001];
int gip[10001];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.ans","w",stdout);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>guaili[i];
    }
     guaili[n+1]=0;
    int ans=0;
    sort(guaili,guaili+n-1);
    for(int i=1; i<=n; i++)
    {
        if(guaili[i]==guaili[i-1])
        {
            ans=ans;
            guaili[i]=-1;
        }
        else if(guaili[i]!=-1)
        {
            ans++;
            gip[ans]=guaili[i];
        }
    }
    int box=0;
    for(int i=ans; i>=0; i--)
    {
        if(gip[i]>gip[i-1])
            box++;
    }
    cout<<box;
    return 0;
}
